home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / nemerle.lang < prev    next >
Encoding:
Extensible Markup Language  |  2010-08-16  |  8.3 KB  |  263 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Pawe┼é W. Olszta <pawel.olszta@nemerle.org>
  5.  Copyright (C) 2004 Pawe┼é W. Olszta <pawel.olszta@nemerle.org>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="nemerle" _name="Nemerle" version="2.0" _section="Sources">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-nemerle</property>
  26.     <property name="globs">*.n</property>
  27.     <property name="line-comment-start">//</property>
  28.     <property name="block-comment-start">/*</property>
  29.     <property name="block-comment-end">*/</property>
  30.   </metadata>
  31.  
  32.   <styles>
  33.     <style id="comment" _name="Comment" map-to="def:comment"/>
  34.     <style id="error" _name="Error" map-to="def:error"/>
  35.     <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
  36.     <style id="character" _name="Character" map-to="def:character"/>
  37.     <style id="string" _name="String" map-to="def:string"/>
  38.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  39.     <style id="type" _name="Data Type" map-to="def:type"/>
  40.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  41.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  42.     <style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
  43.     <style id="decimal" _name="Decimal number" map-to="def:decimal"/>
  44.     <style id="binary" _name="Binary number" map-to="def:base-n-integer"/>
  45.     <style id="octal" _name="Octal number" map-to="def:base-n-integer"/>
  46.     <style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/>
  47.   </styles>
  48.  
  49.   <definitions>
  50.  
  51.     <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
  52.       <start>//</start>
  53.       <include>
  54.         <context ref="def:in-line-comment"/>
  55.       </include>
  56.     </context>
  57.  
  58.     <context id="block-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
  59.       <start>/\*</start>
  60.       <end>\*/</end>
  61.       <include>
  62.         <context ref="def:in-comment"/>
  63.       </include>
  64.     </context>
  65.  
  66.     <context id="close-comment-outside-comment" style-ref="error">
  67.       <match>\*/(?!\*)</match>
  68.     </context>
  69.  
  70.     <define-regex id="preproc-start">^\s*#\s*</define-regex>
  71.  
  72.     <context id="if-false-comment" style-ref="comment">
  73.       <start>\%{preproc-start}if\s*false\b</start>
  74.       <end>\%{preproc-start}(endif|else|elif)\b</end>
  75.       <include>
  76.         <context id="if-in-if-false">
  77.           <start>\%{preproc-start}if(n?def)?\b</start>
  78.           <end>\%{preproc-start}endif\b</end>
  79.           <include>
  80.             <context ref="if-in-if-false"/>
  81.             <context ref="def:in-comment"/>
  82.           </include>
  83.         </context>
  84.         <context ref="def:in-comment"/>
  85.       </include>
  86.     </context>
  87.  
  88.     <context id="preprocessor" style-ref="preprocessor" end-at-line-end="true">
  89.       <start extended="true">
  90.         \%{preproc-start}
  91.         (define|undef|if(n?def)?|else|elif|endif|line|error|warning|region|endregion)
  92.         \b
  93.       </start>
  94.       <include>
  95.         <context ref="line-comment"/>
  96.         <context ref="block-comment"/>
  97.       </include>
  98.     </context>
  99.  
  100.     <context id="character" style-ref="character">
  101.       <match>'(\\)?.'</match>
  102.     </context>
  103.  
  104.     <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
  105.       <start>'</start>
  106.       <end>'</end>
  107.       <include>
  108.         <context ref="def:escape"/>
  109.         <context ref="def:line-continue"/>
  110.       </include>
  111.     </context>
  112.  
  113.     <context id="keywords" style-ref="keyword">
  114.       <keyword>_</keyword>
  115.       <keyword>abstract</keyword>
  116.       <keyword>and</keyword>
  117.       <keyword>array</keyword>
  118.       <keyword>as</keyword>
  119.       <keyword>base</keyword>
  120.       <keyword>catch</keyword>
  121.       <keyword>class</keyword>
  122.       <keyword>def</keyword>
  123.       <keyword>do</keyword> 
  124.       <keyword>else</keyword>
  125.       <keyword>extends</keyword>
  126.       <keyword>extern</keyword>
  127.       <keyword>finally</keyword>
  128.       <keyword>foreach</keyword>
  129.       <keyword>for</keyword> 
  130.       <keyword>fun</keyword>
  131.       <keyword>if</keyword>
  132.       <keyword>implements</keyword>
  133.       <keyword>in</keyword>
  134.       <keyword>interface</keyword>
  135.       <keyword>internal</keyword>
  136.       <keyword>lock</keyword>
  137.       <keyword>macro</keyword>
  138.       <keyword>match</keyword>
  139.       <keyword>module</keyword>
  140.       <keyword>mutable</keyword>
  141.       <keyword>namespace</keyword>
  142.       <keyword>new</keyword>
  143.       <keyword>out</keyword>
  144.       <keyword>override</keyword>
  145.       <keyword>params</keyword>
  146.       <keyword>private</keyword>
  147.       <keyword>protected</keyword>
  148.       <keyword>public</keyword>
  149.       <keyword>ref</keyword>
  150.       <keyword>repeat</keyword>
  151.       <keyword>sealed</keyword>
  152.       <keyword>static</keyword>
  153.       <keyword>struct</keyword>
  154.       <keyword>syntax</keyword>
  155.       <keyword>this</keyword>
  156.       <keyword>throw</keyword>
  157.       <keyword>try</keyword>
  158.       <keyword>type</keyword>
  159.       <keyword>typeof</keyword>
  160.       <keyword>unless</keyword>
  161.       <keyword>until</keyword>
  162.       <keyword>using</keyword>
  163.       <keyword>variant</keyword>
  164.       <keyword>virtual</keyword>
  165.       <keyword>when</keyword>
  166.       <keyword>where</keyword>
  167.       <keyword>while</keyword>
  168.     </context>
  169.  
  170.     <context id="types" style-ref="type">
  171.       <keyword>bool</keyword>
  172.       <keyword>byte</keyword>
  173.       <keyword>char</keyword>
  174.       <keyword>decimal</keyword>
  175.       <keyword>double</keyword>
  176.       <keyword>float</keyword>
  177.       <keyword>int</keyword>
  178.       <keyword>list</keyword>
  179.       <keyword>long</keyword>
  180.       <keyword>object</keyword>
  181.       <keyword>sbyte</keyword>
  182.       <keyword>short</keyword>
  183.       <keyword>string</keyword>
  184.       <keyword>uint</keyword>
  185.       <keyword>ulong</keyword>
  186.       <keyword>ushort</keyword>
  187.       <keyword>void</keyword>
  188.     </context>
  189.  
  190.     <context id="null-value" style-ref="null-value">
  191.       <keyword>null</keyword>
  192.     </context>
  193.  
  194.     <context id="boolean" style-ref="boolean">
  195.       <keyword>false</keyword>
  196.       <keyword>true</keyword>
  197.     </context>
  198.  
  199.     <context id="float" style-ref="floating-point">
  200.       <match extended="true">
  201.         (?<![\w\.])
  202.         [0-9]*\.[0-9]+([eE][-+]?[0-9]+)?
  203.         (?![\w\.])
  204.       </match>
  205.     </context>
  206.  
  207.     <context id="decimal" style-ref="decimal">
  208.       <match extended="true">
  209.         (?<![\w\.])
  210.         [0-9]+[Uu]?([Ll]|[Ss]|[Bb])?
  211.         (?![\w\.])
  212.       </match>
  213.     </context>
  214.  
  215.     <context id="binary" style-ref="binary">
  216.       <match extended="true">
  217.         (?<![\w\.])
  218.         0[bB][01]+[Uu]?([Ll]|[Ss]|[Bb])?
  219.         (?![\w\.])
  220.       </match>
  221.     </context>
  222.  
  223.     <context id="octal" style-ref="octal">
  224.       <match extended="true">
  225.         (?<![\w\.])
  226.         0[oO][0-7]+[Uu]?([Ll]|[Ss]|[Bb])?
  227.         (?![\w\.])
  228.       </match>
  229.     </context>
  230.  
  231.     <context id="hexadecimal" style-ref="hexadecimal">
  232.       <match extended="true">
  233.         (?<![\w\.])
  234.         0[xX][0-9a-fA-F]+[Uu]?([Ll]|[Ss]|[Bb])?
  235.         (?![\w\.])
  236.       </match>
  237.     </context>
  238.  
  239.     <context id="nemerle" class="no-spell-check">
  240.       <include>
  241.         <context ref="line-comment"/>
  242.         <context ref="block-comment"/>
  243.         <context ref="close-comment-outside-comment"/>
  244.         <context ref="if-false-comment"/>
  245.         <context ref="preprocessor"/>
  246.         <context ref="character"/>
  247.         <context ref="string"/>
  248.         <context ref="keywords"/>
  249.         <context ref="types"/>
  250.         <context ref="null-value"/>
  251.         <context ref="boolean"/>
  252.         <context ref="float"/>
  253.         <context ref="decimal"/>
  254.         <context ref="binary"/>
  255.         <context ref="octal"/>
  256.         <context ref="hexadecimal"/>
  257.       </include>
  258.     </context>
  259.  
  260.   </definitions>
  261.  
  262. </language>
  263.